package com.dayaokeji.rhythmschoolstudent.client.common.questions_and_answers;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Gorden on 2018/1/25.
 */

public class QuestionAnsersPagerAdapter extends FragmentPagerAdapter {

    private Fragment[] fragments;

    private static final String[] titles = {"全部问答","个人问答"};

    public QuestionAnsersPagerAdapter(FragmentManager fm, Fragment[] fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
